using System.Collections.Generic;
using System.IO;
using System.Runtime;
using Godot;

class ActorUtil
{
    public static string getActorResourcePath(ActorResourceType type, int roleId)
    {
        List<ConfigCharacterResourceInfo> configs = ConfigManager.getInstance().findConfigByConditionInDb<ConfigCharacterResourceInfo>("ConfigCharacterResourceInfo", "roleId=" + roleId + " and resourceTypeID=" + (int)type);
        if (configs.Count == 0)
        {
            GD.PrintErr("没有对应的资源配置:" + type + "," + roleId);
            return null;
        }
        return "res://resouces/actorHeadSprite/" + configs[0].resourceName + ".png";

    }

    public static ConfigCharacterBaseInfo getActorBaseInfo(int roleId)
    {
        List<ConfigCharacterBaseInfo> configs = ConfigManager.getInstance().findConfigByConditionInDb<ConfigCharacterBaseInfo>("ConfigCharacterBaseInfo", "ID=" + roleId);
        if (configs.Count == 0)
        {
            GD.PrintErr("没有对应的角色配置:" + roleId);
            return null;
        }
        return configs[0];
    }
}